#include "tdialog.h"
//#include "keydefine.h"
#include "common/tdebug.h"

TDialog::TDialog(QWidget *parent) :
    QDialog(parent)
{

    this->setWindowFlags(Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint);
    this->setAttribute(Qt::WA_DeleteOnClose);
    this->setFocus();
}


#ifdef GRAB_SCREEN
#include <mainwindow.h>
#endif

void TDialog::keyPressEvent(QKeyEvent *event)
{
    int key = event->key();
    qDebug()<<key<<"123145678900";
    if(/*key==KEY_BACK*/0)
        this->reject();
 #ifdef GRAB_SCREEN
    else if(key==KEY_ZERO)
    {
        MainWindow::grabScreen();
        return;
    }
 #endif
    else
    {
        QDialog::keyPressEvent(event);
    }
}
